package com.atguigu.ggkt.sequence.controller;

import com.atguigu.ggkt.result.Result;
import com.atguigu.ggkt.sequence.service.SequenceService;
import com.atguigu.ggkt.sequence.service.impl.SequenceImpl_1;
import com.atguigu.ggkt.utils.SpringTool;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * </p>
 */
@RestController
@RequestMapping("api/sequence")
public class SequenceController {

    @ApiOperation(value = "获取流水号")
    @GetMapping("get")
    public Result get(
//            @ApiParam(name = "pattern", value = "模式", required = true)
//            @PathVariable Long pattern,
//            @ApiParam(name = "howmany", value = "要多少个", required = true)
//            @PathVariable Long howmany
            ) throws Exception {
        SequenceService service = (SequenceService)SpringTool.getSpringBean(SequenceImpl_1.class);
        String seq = service.create();
        return Result.ok(seq);
    }

    public static void main(String[] args) {
        System.out.println("20240817211259154P000000014".length());
    }
}

